<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core"  prefix="c"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn"%> 
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head lang="zh-CN">
    <base href="<%=basePath%>">
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>用户资料完善</title>
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
	<link href="bootstrap/css/bootstrap.min.css" rel="stylesheet">
	<script type="text/javascript" src="js/jquery-1.11.3.min.js"></script>
	<link rel="stylesheet" type="text/css" href="js/mdialog.css">
	<script src="js/zepto.js"></script>

	<script src="js/zpDialog.js"></script>
	<script src="js/zpDialogTwo.js"></script>
	<script src="js/zpDialogThree.js"></script>
	<script src="js/zpDialogFour.js"></script>
	<script src="js/zpDialogFive.js"></script>
	<script src="js/zpDialogSix.js"></script>
	<script src="js/zpDialogSeven.js"></script>
	<script type="text/javascript" src="js/zepto.min.js"></script>
	<script type="text/javascript" src="js/mdialog.js"></script>
	<script type="text/javascript" src="js/jquery.js"></script> 
	<script type="text/javascript" src="js/sweetalert.min.js"></script>
	<link rel="stylesheet" type="text/css" href="js/css/sweetalert.css"/>
	<link rel="stylesheet" href="js/css/main.css" />
	<style type="text/css">
	#imghead1{
    		width:310px; 
	        height:310px; 
	        border-radius: 180px;
    	}
		.round {
		   padding:10px; width:300px; height:50px;
		   border: 0px solid #dedede;
		   -moz-border-radius: 5px;      /* Gecko browsers */
		   -webkit-border-radius: 5px;   /* Webkit browsers */
		   border-radius:5px;            /* W3C syntax */
		}
		#imghead2{
    		width:50px; 
	        height:50px; 
	        border-radius:200px; 
    	}
	
  	</style>
	   <style> 
.loadingWrap{  
    position:fixed;  
    top:0;  
    left:0;  
    width:100%;  
    height:100%;  
    z-index:300;  
    background-image:url(csh/image/loading.gif);  
    background-repeat:no-repeat;  
    background-position:center center;  
    background-color:#000;  
    background-color:rgba(0,0,0,0.5);  
    filter:alpha(opacity=50);  
}  
</style>
<style>
.demo{width:300px; margin:60px auto 10px auto}
@media only screen and (min-width: 420px) {
	.demo{width:500px; margin:60px auto 10px auto}
}
button, .button {
	background-color: #AEDEF4;color: white;border: none;box-shadow: none;
	font-size: 17px;font-weight: 500;font-weight: 600;
	border-radius: 3px;padding: 15px 35px;margin: 26px 5px 0 5px;cursor: pointer; }
button:hover, .button:hover {background-color: #a1d9f2; }
</style>
<script type="text/javascript" src="jquery/1.9.1/jquery.min.js"></script> 
<script type="text/javascript" src="layer/2.4/layer.js"></script>
<script type="text/javascript">

	 function one(id,openid){
		 debugger;
		 	var openidto = openid;
		 	var yid2 = id;
	   	   	var address=document.getElementById("address").value;
	   	   	var dong=document.getElementById("dong").value;
	   	 	var ysex=document.getElementById("ysex").value;
	   	   	var nickname=document.getElementById("nickname").value;
	   	   	var moblie=document.getElementById("mobile").value;
	   	   	//var name = /^[\u4E00-\u9FA5]{2,8}$/; 
	   	   var name = /(?!(\D*\d){4})^[\u4e00-\u9fa5\w]{2,12}$/;
	   	   	var phone =/^1[3|5|7|8]\d{9}$/;
	   	   	if(!name.test(nickname)){
	   	   		alert("请输入2-12位中文或者字母或者数字，总数不能超过12位（数字的个数不能超过4个）");
	   	  	 }else if(!phone.test(moblie)){	
	   	   		alert("手机号码不符");
	   	  	 }
	   	 	  else{
	   	 		var paer={yid:yid2,address:address,dong:dong,ysex:ysex,nickname:nickname,moblie:moblie,openid:openidto};
	   		$.ajax({   			
				url:"${path}/weixinbassm/weixingzh/addUserweixin",
				data:paer,
				type:"post",
				async:false,
				success:function(date){
					if(date.msg==1){
						window.location.href = "${path}/weixinbassm/weixintisi.jsp";
					}else{
						window.location.href = "${path}/weixinbassm/shibai.jsp";	
					}
				},
				error:function(){
					alert("异常错误，请联系供应商");
				}
			});
	   	   	}
	    };
</script>
<script type="text/javascript">
	function onereturn(cardnumber,openid){
		var cardnumberto =cardnumber;
		var openidto=openid;
		window.location.href = "${path}/weixinbassm/weixingzh/Selectionofcommunity?openid="+openidto+"&cardnumber="+cardnumberto;
	}
</script>
</head>
  <body >
  	<div class="container-fluid">
      <div class="row">
      	<form id="form" action="<%=path%>/u/add" method="post" enctype="multipart/form-data">
      	<input type="hidden" id="openid" name="openid" value="${openid}">
      	
     	<table border="0px solid red" width="100%" height="100%">
     		<!-- <tr height="8%" style=" background-color:#373a3b;"> 
     		<td style="width: 35px" onclick="imageUpload()">&nbsp;<img alt="" src="img/return.jpg" style="width: 25px;height: 20px"></td>
     		<td style="width: 260px;color: white;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;用户资料完善</td>
     		</tr> -->
     		<tr height="30%">
     			<td colspan="2" align="center">
     				<div style="text-align: center; padding-bottom: 18px;">
	 					<label>
			   		 		<!-- <input type="file"  name="filepath" id="filepath1"  value=""  style="display: none;" /> -->
							    <div id="preview1">
	 								<img alt="" id="img" src="${yfilename}" style="width:120px;height: 120px;border-radius: 60px;">		
	 					  		</div>
						</label>
					</div>
     			</td>
     		</tr>
     		<tr height="1.5%">
     			<td colspan="2" align="center" style="background-color: #f2f3f4">
     			</td>
     		</tr>
     		<tr height="8.5%" >
     			<td style="width: 15%">
 					&nbsp;&nbsp;&nbsp;姓名
 				</td>
 				<td >
 					<input type="text"   name="nikname" id="nickname" value=""   style="height: 35px;width:100%;:#bfc7cc;border-left-width:0px;border-top-width:0px;border-right-width:0px;border:0;padding:0;text-align: right;  padding-right: 15px;" >
 				</td>
     		</tr>
     		<tr	height="0.5%">
     			<td  colspan="2" align="center" style="background-color: #f2f3f4;width: 100%" >
     			</td>
     		</tr>
     		<tr height="8.5%" >
     			<td style="width: 25%">
 					&nbsp;&nbsp;&nbsp;手机号码
 				</td>
 				<td >
 					<input type="text"  name="moblie" id="mobile" value=""  style="height: 35px;width:100%;color:#bfc7cc;border-left-width:0px;border-top-width:0px;border-right-width:0px;border:0;padding:0;text-align: right;  padding-right: 15px;" >
 				</td>
     		</tr>
     		<tr	height="0.5%">
     			<td  colspan="2" align="center" style="background-color: #f2f3f4;width: 100%" >
     			</td>
     		</tr>
     		<tr height="8.5%" >
     			<td style="width: 15%">
 					&nbsp;&nbsp;&nbsp;性别
 				</td>
 				<td >
 					<select name="ysex" id="ysex" style="height: 35px;width:100%;color:#bfc7cc;border-left-width:0px;border-top-width:0px;border-right-width:0px;border:0;padding:0;text-align: right; padding-right: 15px;direction:rtl;">
	    			<option value="男" style="width:270px; height:40px;" >男</option>  
	    			<option value="女" style="width:270px; height:40px;" >女</option> 
	    			</select>
 				</td>
     		</tr>
     		<tr	height="0.5%">
     			<td  colspan="2" align="center" style="background-color: #f2f3f4;width: 100%" >
     			</td>
     		</tr>
     		<tr height="8.5%" >
     			<td style="width: 15%" >
 					&nbsp;&nbsp;&nbsp;小区
 				</td>
 				<td>
 					<input type="text" disabled="disabled" name="address" id="address" value="${yaddress}"  style="height: 35px;width:100%;color:#bfc7cc;border-left-width:0px;border-top-width:0px;border-right-width:0px;border:0;padding:0;text-align: right;  padding-right: 15px;" >
 				</td>
     		</tr>
     		<tr	height="0.5%">
     			<td  colspan="2" align="center" style="background-color: #f2f3f4;width: 100%">
     			</td>
     		</tr>
     		<tr height="8.5%" >
     			<td style="width: 15%">
 					&nbsp;&nbsp;&nbsp;楼栋
 				</td>
 				<td >
 					<%-- <input type="text" name="dong" id="dong" value="${dong}"  style="height: 35px;width:100%;font-size: 20px;color:#bfc7cc;border-left-width:0px;border-top-width:0px;border-right-width:0px;border:0;padding:0;text-align: right;" > --%>
 					<%-- <c:if test="${list=='[]'}">
 						<input type="text" name="dong" id="dong" value="${dong}"  style="height: 35px;width:100%;color:#bfc7cc;border-left-width:0px;border-top-width:0px;border-right-width:0px;border:0;padding:0;text-align: right;  padding-right: 15px;" >
 					</c:if>
 					<c:if test="${list eq null}">
 						<input type="text" name="dong" id="dong" value="${dong}"  style="height: 35px;width:100%;color:#bfc7cc;border-left-width:0px;border-top-width:0px;border-right-width:0px;border:0;padding:0;text-align: right;  padding-right: 15px;" >
 					</c:if>
 					<c:if test="${fn:length(list)>1}">
	 					<select  name="dong" id="dong" style="height: 35px;width:100%;color:#bfc7cc;border-left-width:0px;border-top-width:0px;border-right-width:0px;border:0;padding:0;text-align: right; padding-right: 15px;">
	 						<c:forEach var="v" items="${list}">
	 							<option value="${v}">${v}</option>
	 						</c:forEach>
	 					</select>
 					</c:if> --%>
 					<select name="dong" id="dong" style="height: 35px;width:100%;color:#bfc7cc;border-left-width:0px;border-top-width:0px;border-right-width:0px;border:0;padding:0;text-align: right; padding-right: 15px;direction:rtl;">
	    			<c:forEach var="u" items="${unitdoor}">
	    			<option value=${u.number} style="width:270px; height:40px;" >${u.number}</option>  
	    			</c:forEach>
	    			</select>
 				</td>
     		</tr>
     		<tr	height="0.5%">
     			<td  colspan="2" align="center" style="background-color: #f2f3f4;width: 100%" >
     			</td>
     		</tr>
     		<tr height="28.5%"  style="background-color: #f2f3f4">
					<td  align="center">
						<button  type="button" style="padding: 10px 20px;border-radius: 10px; background:none; border: 0; color: #333; width:170px;height: 50px;font-size: 20px;background-color:#27a2f0;color: #ffffff" onclick="one('${yid}','${openid}')">确定</button>
					</td>
					<td  align="center">
						<button  type="button" style="padding: 10px 20px;border-radius: 10px; background:none; border: 0; color: #333; width:170px;height: 50px;font-size: 20px;background-color:#FF3030;color: #ffffff" onclick="onereturn('${cardnumber}','${openid}')">返回</button>
					</td>
     		</tr>

     	</table>
     	</form>
<!-- 			<div id="code" style="height: 100px;width: 250px" >
  				<div class="code-img" align="center">
  				<img  src="csh/image/603318281.jpg" style="height: 180px;width: 180px;" onclick="tow()">
  				</div> 
			</div> -->
      </div>
    </div>
  </body>
</html>
